import http from "@/api";
import { ResPage } from "@/api/interface";
import {
  CreateCustomersParam,
  DeleteCustomersParam,
  EditCustomersParam,
  HxCustomers,
  QueryCustomersPageListParam,
  QueryCustomersParam
} from "@/api/interface/customers";

const apiName = "Customers";

/** 创建客户 */
export const createCustomers = (param: CreateCustomersParam) => {
  return http.post<string>(`${apiName}/CreateCustomers`, param);
};

/** 查询客户列表（下拉选项用） */
export const queryCustomers = (param: QueryCustomersParam) => {
  return http.post<HxCustomers[]>(`${apiName}/QueryCustomers`, param);
};

/** 查询客户列表分页接口 */
export const queryCustomersPageList = (param: QueryCustomersPageListParam) => {
  return http.post<ResPage<HxCustomers>>(`${apiName}/QueryCustomersPageList`, param);
};

/** 查询我的客户列表分页接口 */
export const queryMyCustomersPageList = (param: QueryCustomersPageListParam) => {
  return http.post<ResPage<HxCustomers>>(`${apiName}/QueryMyCustomersPageList`, param);
};

/** 修改客户信息 */
export const editCustomers = (param: EditCustomersParam) => {
  return http.post<string>(`${apiName}/EditCustomers`, param);
};

/** 删除客户信息 */
export const deleteCustomers = (param: DeleteCustomersParam) => {
  return http.post<string>(`${apiName}/DeleteCustomers`, param);
};
